package simplefactory.store;

import simplefactory.SimpleFruitFactory;
import simplefactory.fruits.abstracts.Fruits;

/**
 * @ClassName: OneFruitStore
 * @Description: 水果店
 * @Date: 2021/1/12 14:39
 * @Author: Song JinGen
 */
public class OneFruitStore {
    SimpleFruitFactory simpleFruitFactory;

    public OneFruitStore(SimpleFruitFactory factory){
        this.simpleFruitFactory = factory;
    }

    public Fruits orderFruit(String type){
        Fruits fruit = simpleFruitFactory.createFruit(type);
        fruit.prepare();
        fruit.box();
        return fruit;
    }
}
